package domain;

import java.util.Objects;

public class Card {

	private String cardId;

	public Card(String cardId){
		super();
		this.cardId = cardId;
	}

	public String getCardId(){
		return cardId;
	}

	public void setCardId(String cardId){
		this.cardId = cardId;
	}

	@Override
	public int hashCode(){
		return Objects.hashCode(cardId);
	}
	/* 覆写Object的equals方法，判断当卡号相等，对象即相等。
	 * （非 Javadoc）
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj){
		if(!(obj instanceof Card)){
			return false;
		}
		Card c =(Card) obj;
		boolean flag= false;
		if(this.cardId.equals(c.getCardId())){
			flag = true;
		}
		return flag;
	}
}
